<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>LiWE: OS3 JS Lib / Array Enhancements</title>
<link rel="stylesheet" href="docs.css" type="text/css" />
<script type="text/javascript" language="javascript" src="docs.js"></script>
</head>
<body onload="prepare_leftbar();">

<div id="title">
LiWE: <a href="index.html">OS3 JS Lib</a> / Array Enhancements
</div>

<div id="leftbar">
</div>

<div id="main">
	<!-- {{{ Introduction -->
	<div class="block">
		<a name="form_intro" title="Introduction"/>
		<div class="title">
			Introduction
		</div>

		<div class="text">
			laskd adj alk jdlak jdlka jdkla jdkl ajkdl jakld jlka jdlka jdlka jdkla jdlk ajkld jalk djla dla djklajsdklajsdklajsd lkasjd
			kasdj sakdj aksd jkas djka jdka jdka jdka jdka jdk ajkd jaksd jaks djkasdj kadj kasjdkajdkajdkasjdka djka jdkajd
			adoaidoa dioaidoa doa idoa idoai lad lakj dlkajd laskj dlaskjd lkasjd lksaj dlkas jdlkajsd
			aosdia sod asodi asod akljd jkash duqd jqkdh qkjdhusdh akjsdajkshduasd hkajsdhsajkdh uas dkashdjakshdua hkjahd jsadh uas
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ count () -->
	<div class="block">
		<a name="array_count" title="Array::count()"/>
		<div class="title">
			Array::count ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">count()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">int count ()</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method <em>counts</em> the elements inside an <tt>Array</tt>. It is similar to the <tt>length</tt> atribute,
						but it also counts <em>keyword attributes</em> and not just values <tt>push()</tt>ed into it.<br />
						<div class="note">Functions associated with the <tt>Array</tt> are skipped in the result of the count.</div>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						NONE
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						An <tt>integer</tt> value: the number of elements inside the <tt>Array</tt>.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ del ( pos, how_many ) -->
	<div class="block">
		<a name="array_del" title="Array::del()"/>
		<div class="title">
			Array::del ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">del()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">void del ( pos [, how_many ] )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method deletes <tt>how_many</tt> elements by the <tt>Array</tt>, starting from the ordinal <tt>pos</tt>
						position.<br />
						If <tt>how_many</tt> is not specified, it defaults to <tt>1</tt>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>pos</tt> - (<tt>integer</tt>) The starting position for the deletion </li>
							<li><tt>how_many</tt> - (<tt>integer</tt>) [<strong>Optional</strong>] How many elements to delete. Defaults to <tt>1</tt></li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						The ordinal position inside the <tt>Array</tt> of the given <tt>key</tt> or <tt>-1</tt> if the <tt>key</tt> has not been found.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ delKey ( pos, how_many ) -->
	<div class="block">
		<a name="array_delKey" title="Array::delKey()"/>
		<div class="title">
			Array::delKey ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">delKey()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">void delKey ( key )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method deletes the element referenced by the associative key <tt>key</tt> from the <tt>Array</tt>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>key</tt> - (<tt>String</tt>) The key to remove from the <tt>Array</tt>.</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						Nothing.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ find ( obj, include_funcs ) -->
	<div class="block">
		<a name="array_find" title="Array::find()"/>
		<div class="title">
			Array::find ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">find()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">pos = find ( key[, case_sens[, include_funcs ] ] )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method scans all the given <tt>Array</tt> looking for the provided <tt>key</tt>. If
						it finds the <tt>key</tt>, its ordinal position value inside the <tt>Array</tt> is returned.<br />
						<tt>key</tt> search is (by default) <em>case insensitive</em>, pass <tt>true</tt> as the second parameter
						to perform a <em>case sensitive</em> search.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>key</tt> - (<tt>String</tt>) The key you are looking for.  </li>
							<li><tt>case_sens</tt> - (<tt>boolean</tt>) [<strong>Optional</strong>] If <tt>true</tt>, the search is performed <em>case sensitive</em>.</li>
							<li><tt>include_funcs</tt> - (<tt>boolean</tt>) [<strong>Optional</strong>] If this is set to <tt>true</tt>, functions names are matches as well.</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						The ordinal position inside the <tt>Array</tt> of the given <tt>key</tt> or <tt>-1</tt> if the <tt>key</tt> has not been found.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ fromForm ( form_id ) -->
	<div class="block">
		<a name="array_fromForm" title="Array::fromForm()"/>
		<div class="title">
			Array::fromForm ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">fromForm()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">Array fromForm ( form_id )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method traverse all the children of <tt>form_id</tt> and gathers all the value of any HTML Input form 
						(inputs, selects, radio and so on) inside an associative array with <tt>name</tt>: <tt>value</tt> pairs.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>form_id</tt> - (<tt>String</tt>) The id of the container of all the HTML Input fields.  </li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						An <tt>Array</tt> rappresentation of the given HTML Input form collection.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ fromObject ( obj, include_funcs ) -->
	<div class="block">
		<a name="array_fromObject" title="Array::fromObject()"/>
		<div class="title">
			Array::fromObject ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">fromObject()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">Array fromObject ( obj [, include_funcs ] )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method returns a new <tt>Array</tt> by converting the object <tt>obj</tt> into a <em>real</em> <tt>Array</tt>.
				
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>obj</tt> - (<tt>Object</tt>) The original JavaScript <tt>Object</tt> to convert.
							</li>
							<li><tt>include_funcs</tt> - (<tt>boolean</tt>) [<strong>Optional</strong>] If this is set to <tt>true</tt>, the <tt>String</tt> 
								rappresentation will include all the user functions defined to the <tt>Array</tt>, otherwise, 
								the functions are skipped.
							</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						An <tt>Array</tt> rappresentation of the given <tt>Object</tt>.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ map ( form_id ) -->
	<div class="block">
		<a name="array_map" title="Array::map()"/>
		<div class="title">
			Array::map ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">map()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">void map ( func )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						Apply function <tt>func</tt> to every item.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>func</tt> - (<tt>Function</tt>) The function to be called for every item.</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						Nothing.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ toSourceString ( include_funcs ) -->
	<div class="block">
		<a name="array_toSourceString" title="Array::toSourceString()"/>
		<div class="title">
			Array::toSourceString ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">toSourceString()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">String toSourceString ( [ include_funcs ] )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method returns a <tt>String</tt> rappresentation of the given <tt>Array</tt>.<br />
						The <tt>String</tt> returned can be used to recreate the <tt>Array</tt> with an <tt>eval()</tt>.
						<br />
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>include_funcs</tt> - (<tt>boolean</tt>) [<strong>Optional</strong>] If this is set to <tt>true</tt>, the <tt>String</tt> 
								rappresentation will include all the user functions defined to the <tt>Array</tt>, otherwise, 
								the functions are skipped.
							</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						A <tt>String</tt> rappresentation of the given <tt>Array</tt>.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
</div>


</body>
</html>
